#!/bin/bash

# Motor Coordinator Server 启动脚本

echo "🚀 启动Motor Coordinator Server..."

# 检查conda环境
if ! command -v conda &> /dev/null; then
    echo "❌ Conda 未安装"
    exit 1
fi

# 激活motor环境
echo "🔧 激活conda motor环境..."
source ~/miniconda3/etc/profile.d/conda.sh
conda activate motor

# 检查依赖
echo "📦 检查依赖..."
pip install fastapi uvicorn httpx

# 设置环境变量 - 确保使用本地代码
export PYTHONPATH="$(pwd):${PYTHONPATH}"

# 启动服务器 - 直接运行本地文件
echo "🌟 启动Coordinator服务器..."
python ../../motor/coordinator/main.py
